package cn.bonoon.kernel.support.services.handler;

import cn.bonoon.kernel.support.entities.EntityTree;

public class OperateTreeDownHandler<E extends EntityTree<E>> extends AbstractTreeUpAndDownHandler<E>{
	public OperateTreeDownHandler(Class<E> entityClass) {
		super(entityClass, "x.ordinal>:ordinal order by x.ordinal asc", 
				"ordinal>? and ordinal<?", "ordinal>? and ordinal<=?", "ordinal>?");
	}
	
	@Override
	protected int getOrdinalDifferentParent(int targetOrdinal) {
		return targetOrdinal + 1;
	}
	
	@Override
	protected int getOrdinalSourceGreate(int targetOrdinal) {
		return targetOrdinal + 1;
	}
}
